<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page  import="com.ambow.Entity.*" %>
<%@ page  import="com.ambow.dao.*" %>
<%@ page  import="com.ambow.dao.impl.*" %>
<%@ page  import="com.ambow.service.*" %>
<%@ page  import="com.ambow.service.impl.*" %>
<%@ page  import="com.ambow.utils.*" %>
<%@ page  import="com.ambow.servlet.*" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="Keywords" content="关键词1,关键词2，关键词3,关键词4,……" />
<meta name="Description" content="你网页的简述" />
<meta name="Robots" content="All" />
<meta name="Generator" content="Dreamweaver" />
<title>入库查询</title>
<link href="<%=path%>/static/css/css.css" rel="stylesheet" type="text/css" />
<link href="<%=path %>/static/css/css.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' });
    $( "#datepicker1" ).datepicker({ dateFormat: 'yy-mm-dd' });
  } );

  function check(){
	  var startTime = document.getElementById("datepicker").value;   
	    var endTime = document.getElementById("datepicker1").value;   
	    var supplierName=document.getElementById("supplierName").value;
	    var bookName=document.getElementById("bookName").value;
	     if(startTime==""&&startTime==""&&startTime==""&&startTime==""){
		     return true;
		  }else if(startTime==""){
			  alert("请输入起始时间");
			  document.getElementById("datepicker").focus();
			  return false;
			  } else if(endTime==""){
				  alert("请输入终止时间");
				  document.getElementById("datepicker1").focus();
				  return false;
			}else if(supplierName==""){
				alert("请输入供应商");
				  document.getElementById("supplierName").focus();
				  return false;
				}
			else if(bookName==""){
				alert("请输入教材名");
				  document.getElementById("bookName").focus();
					return false;
				} 
			return true;     
		}     

	
  </script>
</head>

<body>
	<h3 id="subTitle">入库查询</h3>
	<ul id="button">
		<li><a href="receive_query.jsp">打 印</a></li>

	</ul>
	<table width="90%" border="0" align="center" cellpadding="0"
		cellspacing="0" class="table2">
		<form action="<%=path %>/StockReceiveServlet?status=record" method="post" name="frm" onsubmit="return check()">
			<tr>
				<td width="" nowrap="nowrap" align="right">起始时间：</td>
				<td nowrap="nowrap"><input  id ="datepicker" name="startTime" type="text"
					class="input2"/>
					<td width="" nowrap="nowrap" align="right">终止时间：</td>
					<td nowrap="nowrap"><input id ="datepicker1" name="endTime" type="text"
						class="input2"  />
			</tr>
			<tr>
				<td width="" nowrap="nowrap" align="right">供应商名称：</td>
				<td nowrap="nowrap"><input name="supplierName" type="text"
					class="input2" id="supplierName" />
					<td width="" nowrap="nowrap" align="right">教材名称：</td>
					<td nowrap="nowrap"><input name="bookName" type="text"
						class="input2" id="bookName"/> <input name="Submit" type="submit"
						class="buttonInp" value="查 询" /></td>
			</tr>
		
	</table>
	<table width="90%" border="0" align="center" cellpadding="0"
		cellspacing="0" class="table" style="margin-top: 10px;">
	
			<tr>
				<th width="20%" align="center" nowrap="nowrap" class="title2">供应商名称</th>
				<th width="30%" align="center" nowrap="nowrap" class="title2">教材名称</th>
				<th width="15%" align="center" nowrap="nowrap" class="title2">单价</th>
				<th width="15%" align="center" nowrap="nowrap" class="title2">数量</th>
				<th width="20%" align="center" nowrap="nowrap" class="title2">入库时间</th>
			</tr>
			<% 
			List<StockReceive> list=(List)request.getAttribute("list");
			if(list!=null&&list.size()!=0){
			   for(StockReceive stockReceive :list){
				
			%>
			<tr class="within2bg">
				<td align="center"><%=stockReceive.getSupplier().getName()%></td>
				<td align="center"><a href="<%=path%>/StockReceiveServlet?status=queryOne&id=<%=stockReceive.getTextBook().getId()%>"><%=stockReceive.getTextBook().getName() %></a></td>
				<td align="center"><%=stockReceive.getTextBook().getPrice()%></td>
				<td align="center"><%=stockReceive.getAmount()%></td>
				<td align="center"><%=stockReceive.getReceiveDate()%></td>
				
				</td>
			

			</tr>
          <%   
		
				
			   }	
				
			}else{%>
        	  <tr align="center" class="within2bg">
				<td colspan="7" class="no_note">没有符合条件的记录</td>
			</tr>
			<%
			}
			%>
		</form>
	</table>
	
</body>
</html>